package com.cityos.android.mystudynestedscroll.ui.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.MotionEvent
import android.widget.Toast
import androidx.core.view.ViewCompat
import com.cityos.android.mystudynestedscroll.common.utils.LoggerUtils
import com.cityos.android.mystudynestedscroll.common.utils.MotionEventPrinter
import com.cityos.android.mystudynestedscroll.databinding.ActivityDispatchTouchEventBinding

class DispatchTouchEventActivity : AppCompatActivity() {
    private lateinit var mainBinding: ActivityDispatchTouchEventBinding
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mainBinding = ActivityDispatchTouchEventBinding.inflate(layoutInflater).apply {
            setContentView(this.root)
        }

        mainBinding.myView.setOnClickListener {
            Toast.makeText(this , "dfasdfasd" , Toast.LENGTH_SHORT).show()
        }

    }

//    override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
//        LoggerUtils.justE("start------------------------------>Activity.dispatchTouchEvent:${MotionEventPrinter.getEventNameStr(ev)}" , "DispatchTouchEventActivity")
//        val a = super.dispatchTouchEvent(ev)
//        LoggerUtils.justE("end------------------------------>Activity.dispatchTouchEvent = $a:${MotionEventPrinter.getEventNameStr(ev)}" , "DispatchTouchEventActivity")
//        return a
//    }
//
//
//    override fun onTouchEvent(event: MotionEvent?): Boolean {
//        LoggerUtils.justE("start------------------------------>Activity.onTouchEvent:${MotionEventPrinter.getEventNameStr(event)}" , "DispatchTouchEventActivity")
//        val a = super.onTouchEvent(event)
//        LoggerUtils.justE("end------------------------------>Activity.onTouchEvent = $a:${MotionEventPrinter.getEventNameStr(event)}" , "DispatchTouchEventActivity")
//        return a
//    }

}

